from .api import chat, user
from message_broker.apis import state
from .websocket import broker, check_in

urlpatterns = [
    # 中控主 websocket
    (r'v2/ngx/center/units/(?P<unit_id>\w+)/?', broker.WebSocketHandler),
    # 签到
    (r'v1/units/(?P<unit_id>\w+)/signin/(?P<check_in_id>\w+)/websocket',
     check_in.CheckInWebSocket),
    # 聊天
    (r'v2/units/(?P<unit_id>\w+)/chat/message', chat.TextMessageHandler),
    (r'v2/units/(?P<unit_id>\w+)/chat/image', chat.ImageMessageHandler),
    (r'v2/units/(?P<unit_id>\w+)/forbid_talkers', chat.BlacklistHandler),
    # 用户
    (r'v2/units/(?P<unit_id>\w+)/users', user.OnlineUserHandler),
    # 状态
    (r'v2/units/(?P<room_id>\w+)/modules/status', state.StateHandler),
    (r'v2/units/(?P<room_id>\w+)/modules/list', state.StateHistoryHandler),
    # mod
    (r'v2/openapi/instructions/add', state.StateAddHandler)
]
